
const  apiBaseUrl = "https://api.it120.cc/jwl"

// 二次封装  wx.request()   

export  const   Request = (params) =>{
  wx.showLoading({
    title: '玩命加载中...',
  })
  return  new Promise((resolve,reject) =>{
    wx.request({
      ...params,
      url: apiBaseUrl+params.url,
      header:{
       "content-type" : "application/x-www-form-urlencoded"
      },
      success:(data) =>{
        resolve(data.data)
      },
      fail: (err) =>{
        reject(err)
      },
      complete:wx.hideLoading
    })
  })
}



